//
//  ComfirmCell.m
//  PropertyMananger
//
//  Created by Mansion on 17/2/11.
//  Copyright © 2017年 BH. All rights reserved.
//

#import "ComfirmCell.h"

@implementation ComfirmCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
+ (instancetype)cellWithTableView:(UITableView *)tableView
{
    static NSString *ComfirmCellID = @"ComfirmCell";
    ComfirmCell * cell = [tableView dequeueReusableCellWithIdentifier:ComfirmCellID];
    if (!cell) {
        
        cell = [[ComfirmCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:ComfirmCellID];
    }
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    return cell;
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
    
        self.cancelBtn = [UIButton buttonWithType:UIButtonTypeCustom];
        [self.contentView addSubview:self.cancelBtn];
        
        [self.cancelBtn setTitle:@"取消" forState:UIControlStateNormal];
        [self.cancelBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
        self.cancelBtn.backgroundColor = BHColor(93, 95, 110);
        self.cancelBtn.titleLabel.font = BHFont(16);
        self.cancelBtn.tag = cancelBtnTag;

        
        self.cancelBtn.layer.cornerRadius = 5;
        self.cancelBtn.layer.masksToBounds = YES;
        
        [self.cancelBtn mas_makeConstraints:^(MASConstraintMaker *make) {
            make.leading.equalTo(self.contentView).with.offset(15);
            make.centerY.equalTo(self.contentView).with.offset(0);
            make.size.mas_equalTo(CGSizeMake(BHscreenW/2 - 30,44));
        }];
        
        self.comfirmBtn = [UIButton buttonWithType:UIButtonTypeCustom];
        [self.contentView addSubview:self.comfirmBtn];
        
        [self.comfirmBtn setTitle:@"确定" forState:UIControlStateNormal];
        [self.comfirmBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
        self.comfirmBtn.backgroundColor = Theme_Color;
        self.comfirmBtn.titleLabel.font = BHFont(16);
        self.comfirmBtn.tag = ComfirmBtnTag;
        
        self.comfirmBtn.layer.cornerRadius = 5;
        self.comfirmBtn.layer.masksToBounds = YES;
        
        [self.comfirmBtn mas_makeConstraints:^(MASConstraintMaker *make) {
            make.trailing.equalTo(self.contentView).with.offset(-15);
            make.centerY.equalTo(self.contentView).with.offset(0);
            make.size.mas_equalTo(CGSizeMake(BHscreenW/2 - 30,40));
        }];

    }
    
    return self;
}
@end
